import { PlusOutlined, DeleteOutlined, ExportOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons-vue'
import type { ButtonConfig } from '@/components/common/Operations.vue'
import { useI18n } from 'vue-i18n'

/**
 * 获取左侧按钮配置
 * @param selectedCount 已选择的行数量
 * @returns 左侧按钮配置数组
 */
export const useLeftButtons = (selectedCount: number): ButtonConfig[] => {
  const { t } = useI18n()
  return [
    {
      text: t('user.add'),
      event: 'add',
      icon: PlusOutlined,
      type: 'primary'
    },
    {
      text: t('common.batchDelete'),
      event: 'batchDelete',
      icon: DeleteOutlined,
      type: 'primary',
      danger: true,
      disabled: selectedCount === 0
    },
    {
      text: t('user.export'),
      event: 'export',
      icon: ExportOutlined
    },
    {
      text: t('common.refresh'),
      event: 'refresh',
      icon: ReloadOutlined
    }
  ]
}

/**
 * 获取右侧按钮配置
 * @returns 右侧按钮配置数组
 */
export const useRightButtons = (): ButtonConfig[] => {
  const { t } = useI18n()
  return [
    {
      text: t('common.search'),
      event: 'search',
      icon: SearchOutlined,
      type: 'primary'
    },
    {
      text: t('common.reset'),
      event: 'reset',
      icon: ReloadOutlined
    }
  ]
} 